package org.nmgyjt.springboot.beans.vo;

import lombok.Data;

import java.util.List;


/**
 * @author llk
 * @date 2022-10-24 11:46
 */
@Data
public class IdaasPageResponse<T> {

    private Long total = 0L;

    private List<IdaasData<T>> data;



    // default value
    protected transient long size = 10;

    protected transient long current = 1;

    public Long getPages() {
        if (getSize() == 0) {
            return 0L;
        }
        long pages = getTotal() / getSize();
        if (getTotal() % getSize() != 0) {
            pages++;
        }
        return pages;
    }

    public boolean hasNext() {
        return this.current < getPages();
    }

}
